using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PACKETPARSERMAX20.CORE;

namespace PACKETPARSERMAX20.CORE.DEFINITIONS
{
    public class SMSG_MOVE_KNOCK_BACK_DEF : DefinitionBase
    {

        public override bool Process()
        {
            ResetPosition();
            UInt64 targetguid = popGuid();
            UInt32 Sequence = ReadUInt32();                               // Sequence
            float vcos = ReadSingle();                                   // x direction
            float vsin = ReadSingle();                                    // y direction
            float Horizontalspeed = ReadSingle();// Horizontal speed
            float ZMovementspeed = ReadSingle();     // Z Movement speed


            
           // InitLog(); //start the log

          //  if(LogIt) LogAppendLine("UInt64", "targetguid", targetguid, true);
          //  if(LogIt) LogAppendLine("UInt32", "sequence", Sequence);
          //  if(LogIt) LogAppendLine("float", "vcos", vcos);
          //  if(LogIt) LogAppendLine("float", "vsin", vsin);
          //  if(LogIt) LogAppendLine("float", "Horizontalspeed", Horizontalspeed);
          //  if(LogIt) LogAppendLine("float", "ZMovementspeed", ZMovementspeed);


            System.IO.StreamWriter sww = new System.IO.StreamWriter("found.log", true);
            sww.WriteLine(string.Format("{0}\t{1}\t{2}", "SMSG_MOVE_KNOCK_BACK", base.context.Reader.CurrentIndex, context.Reader.FileName));
            sww.Close();
            Warning = "SMSG_MOVE_KNOCK_BACK";
            return Validate();
        }
    }
}

